package com.jinlia.show.modules.base.model.po;

import com.jinlia.show.modules.base.system.entity.DeliveryOrder;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class DeliveryOrderPO extends DeliveryOrder {
    /**
     * 销售订单
     */
    private OrderPO orderPO;

    /**
     * @param entity
     * @return
     */
    public static DeliveryOrderPO fromEntity(DeliveryOrder entity) {
        DeliveryOrderPO vo = new DeliveryOrderPO();
        BeanUtils.copyProperties(entity, vo);
        return vo;
    }

    public static DeliveryOrder toEntity(DeliveryOrderPO vo) {
        DeliveryOrder entity = new DeliveryOrder();
        BeanUtils.copyProperties(vo, entity);
        return entity;
    }
}
